﻿Imports Control_Vuelos_BL
Imports DevExpress.XtraPrinting

Public Class frmMaestroTrabajadorCuenta
    Inherits frmBaseMantenimiento
    Dim oTrabajadorCuenta As New TrabajadorCuentaBL

    Public printingSystem1 As New PrintingSystem()
    Public printableComponentLink1 As New PrintableComponentLink()


    Private Sub frmMaestroTrabajadorCuenta_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
        BarBtnCancelar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
        BarBtnEliminar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
        BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
        BarBtnModificar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
        AddHandler BarBtnRefresh.ItemClick, AddressOf GetTrabajadorCuenta
        AddHandler BarBtnImprimir.ItemClick, AddressOf Imprimir
        GetTrabajadorCuenta()

        PrintingSystem1.Links.AddRange(New Object() {printableComponentLink1})
        printableComponentLink1.Component = GridControl1
        printableComponentLink1.Landscape = True

    End Sub

    Public Sub GetTrabajadorCuenta()
        GridControl1.DataSource = oTrabajadorCuenta.ListarCentroCostoXTrabajadorResidencia("001")
        GridView1.BestFitColumns()

    End Sub

    Public Sub Imprimir()
        printableComponentLink1.ShowPreview()
    End Sub
End Class